<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <input type="text">
    <button>提交</button>
    <script>
        var btn = document.querySelector("button");

        btn.onclick = function(){
            var count = 5;
           btn.innerText = count +"s";
           btn.disabled = true;
        var  timer = setInterval(function(){
            btn.innerText = count +"s";
            count--;
            if(count==0){
                clearInterval(timer);
                btn.innerText = "发送";
                btn.disabled = false;
            }
        },500);
            
        }
    </script>
</body>
</html>